package com.watson.s2sh.platform.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.watson.s2sh.platform.domain.Permission;
import com.watson.s2sh.platform.service.PermissionService;

public class PermissionAction extends ActionSupport {
	private static final long serialVersionUID = 1L;

	private Permission permission;
	private List<Permission> permissionList;
	
	private PermissionService permissionService;
	
	public String openPermissionList() throws Exception {
		System.out.println("open Permission List Page!");
		permissionList = permissionService.findAllPermission();
		return SUCCESS;
	}
	
	public String openPermission() throws Exception {
		System.out.println("open Permission page!");
		return SUCCESS;
	}
	
	public String savePermission() throws Exception {
		permissionService.save(permission);
		System.out.println("open save successful!");
		return SUCCESS;
	}

	public Permission getPermission() {
		return permission;
	}

	public void setPermission(Permission permission) {
		this.permission = permission;
	}

	public PermissionService getPermissionService() {
		return permissionService;
	}

	public void setPermissionService(PermissionService permissionService) {
		this.permissionService = permissionService;
	}

	public List<Permission> getPermissionList() {
		return permissionList;
	}

	public void setPermissionList(List<Permission> permissionList) {
		this.permissionList = permissionList;
	}

}